jade.content.schema
Class ObjectSchema

java.lang.Object
  |
  +--jade.content.schema.ObjectSchema
Direct Known Subclasses:
ContentElementSchema, TermSchema

public abstract class ObjectSchema
extends java.lang.Object

Author:
Federico Bergenti - Universita` di Parma

Field Summary
static int MANDATORY
           
static int OPTIONAL
           
 
Constructor Summary
protected ObjectSchema(java.lang.String typeName)
          Constructor
 
Method Summary
protected  void addBaseSchema(ObjectSchema base)
          Adds a base schema.
protected  void addElement(java.lang.String name, ObjectSchema elementSchema)
          Add an attribute to the schema.
protected  void addElement(java.lang.String name, ObjectSchema elementSchema, int cardinality)
          Add an attribute to the schema.
 java.lang.String[] getNames()
          Returns the names of all attributes.
 ObjectSchema getSchema(java.lang.String name)
          Retrieves an attribute's schema.
 java.lang.String getTypeName()
          Retrieves the name of the type of this schema.
 boolean isAttribute(java.lang.String name)
          Is name an attribute?
 boolean isMandatory(java.lang.String name)
          Is the attribute name mandatory?
abstract  AbsObject newInstance()
          Creates a new instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MANDATORY

public static final int MANDATORY

OPTIONAL

public static final int OPTIONAL
Constructor Detail

ObjectSchema

protected ObjectSchema(java.lang.String typeName)
Constructor
Parameters:
typeName -  
Method Detail

addElement

protected void addElement(java.lang.String name,
                          ObjectSchema elementSchema,
                          int cardinality)
Add an attribute to the schema.
Parameters:
name - name of the attribute.
elementSchema - schema of the attribute.
cardinality - cardinality, i.e., optional or mandatory

addElement

protected void addElement(java.lang.String name,
                          ObjectSchema elementSchema)
Add an attribute to the schema.
Parameters:
name - name of the attribute.
elementSchema - schema of the attribute.

addBaseSchema

protected void addBaseSchema(ObjectSchema base)
Adds a base schema.
Parameters:
base - the base schema.

getNames

public java.lang.String[] getNames()
Returns the names of all attributes.
Returns:
the names of all attributes.

isMandatory

public boolean isMandatory(java.lang.String name)
                    throws OntologyException
Is the attribute name mandatory?
Parameters:
name - name of the attribute.
Returns:
true if the attribute is mandatory.
Throws:
OntologyException -  

isAttribute

public boolean isAttribute(java.lang.String name)
                    throws OntologyException
Is name an attribute?
Parameters:
name - name to test.
Returns:
true if name is an attribute.
Throws:
OntologyException -  

getSchema

public ObjectSchema getSchema(java.lang.String name)
                       throws OntologyException
Retrieves an attribute's schema.
Parameters:
name - name of the attribute.
Returns:
the schema of attribute name
Throws:
OntologyException -  

getTypeName

public java.lang.String getTypeName()
Retrieves the name of the type of this schema.
Returns:
the name of the type.

newInstance

public abstract AbsObject newInstance()
Creates a new instance.
Returns:
the new instance.